from django.urls import path
from . import views
from django.contrib.auth import views as auth_views

urlpatterns = [
    path('', views.index, name='index'),
    path('<int:book_id>/', views.detail, name='detail'),
    path('login/', auth_views.LoginView.as_view(template_name='books/login.html'), name='login'),
    path('logout/', auth_views.LogoutView.as_view(next_page='index'), name='logout'),
    path('mybooks/', views.mybooks, name='mybooks'),
    path('authors/', views.author_list, name='author_list'),
    path('authors/create/', views.author_create, name='author_create'),
    path('authors/<int:author_id>/update/', views.author_update, name='author_update'),
    path('authors/<int:author_id>/delete/', views.author_delete, name='author_delete'),
    path('authors/<int:author_id>/', views.author_detail, name='author_detail'),
    path('librarian/borrowed_books/', views.librarian_borrowed_books, name='librarian_borrowed_books'),
    path('books/create/', views.book_create, name='book_create'),
    path('books/<int:book_id>/update/', views.book_update, name='book_update'),
    path('books/<int:book_id>/delete/', views.book_delete, name='book_delete'),
]